<!DOCTYPE html>
<html lang="en">

<head>
   
    <meta charset="UTF-8">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
  <div id='liYunLong'>你真是个天才！</div>
</body>

</html>
<script>
    var tools = {
        ele: [],
        $: function (id) {
            this.ele.push(document.getElementById(id))
            return this
        },
        setColor: function (color) {
            for (var i = 0; i < this.ele.length; i++) {
                this.ele[i].style.color = color
            }
            return this
        },
        setFontSIze: function (fontsize) {
            for (var i = 0; i < this.ele.length; i++) {
                this.ele[i].style.fontSize = fontsize + 'px'
            }
            return this
        },
        click: function (content) {
            for (var i = 0; i < this.ele.length; i++) {
                this.ele[i].onclick = function () {
                    alert(content)
                }
            }
            return this
        }
    }

    tools.$('liYunLong').setColor('green').setFontSIze('50').click('弹出信息')
</script>